home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / utilities / comms / irc / grapevine / rexx / meter.gvrexx < prev    next >
Encoding:
Text File  |  1995-07-13  |  2.0 KB  |  88 lines

  1. /*) Meter v1.0 by Josef Faulkner (panther@gate.net)  IRC: Arexx
  2. \\\ Written for Grapevine 2.0 beta
  3. ///
  4. \\\ Usage: /meter <percent> <label>
  5. /// <label> will be placed in the box with "OMeter" appended to it
  6. \\\ ie label=Lame will give you [LameOMeter]
  7. /// <percent> can be any number from -25 to 200, if over 200 a + is added
  8. \\\ if under 25, - is appended
  9. (*/
  10. parse arg pct label
  11. label=strip(label)
  12. num=pct
  13. text='['label'OMeter]'
  14. if pct<0 then do
  15.         if pct<-25 then do
  16.                 pct=25
  17.                 text=text||'-'
  18.         end
  19.         pct=pct-2.5
  20.         pct=abs(pct%5)
  21.         do n=1 to pct
  22.                 text=text||'«'
  23.         end
  24.         text=text||'|0%-----25%-----50%-----75%-----100%|'
  25. end
  26. else if pct<=25 then do
  27.         text=text||'|0%'
  28.         pct=(pct+2.5)%5
  29.         call addbar
  30.         call addspace
  31.         text=text||'25%-----50%-----75%-----100%|'
  32. end
  33. else if pct<50 then do
  34.         text=text||'|0%'
  35.         pct=(pct-22.5)%5
  36.         text=text||'»»»»»25%'
  37.         call addbar
  38.         call addspace
  39.         text=text||'50%-----75%-----100%|'
  40. end
  41. else if pct<75 then do
  42.         text=text||'|0%'
  43.         pct=(pct-47.5)%5
  44.         text=text||'»»»»»25%»»»»»50%'
  45.         call addbar
  46.         call addspace
  47.         text=text||'75%-----100%|'
  48. end
  49. else if pct<100 then do
  50.         text=text||'|0%'
  51.         pct=(pct-72.5)%5
  52.         text=text||'»»»»»25%»»»»»50%»»»»»75%'
  53.         call addbar
  54.         call addspace
  55.         text=text||'100%|'
  56. end
  57. else if pct=100 then do
  58.         text=text||'|0%'
  59.         text=text||'»»»»»25%»»»»»50%»»»»»75%»»»»»100%|'
  60. end
  61. else if pct>100 then do
  62.         text=text||'|0%'
  63.         num=pct
  64.         pct=(pct-97.5)%5
  65.         text=text||'»»»»»25%»»»»»50%»»»»»75%»»»»»100%|'
  66.         if num>200 then do
  67.                 addplus=1
  68.                 pct=20
  69.         end
  70.         else addplus=0
  71.         call addbar
  72.         if addplus then text=text||'+'
  73. end
  74. text=text||'('num'%)'
  75. 'say 'text
  76. exit
  77.  
  78. ADDBAR: 
  79.         do n=1 to pct
  80.                 text=text||'»'
  81.         end
  82. return
  83. ADDSPACE:
  84.         do n=1 to 5-pct
  85.                 text=text||'-'
  86.         end
  87. return
  88.